<?php

/**
 * @author Huiyi
 */
class libraryvideos_model extends CI_Model {

    function __construct() {
        parent::__construct();
    }
	
	   function parseLibraryvideosXml($xmlLibraryvideosUrl) {
	   
	   $LibraryvideosOne = array();
	   $title = "";
       $url = "";
       
	   $LibraryvideosOneData = simplexml_load_file($xmlLibraryvideosUrl);
       $LibraryvideosInfoList = array();
		
		//get the number of videos
		$videoCount = count($LibraryvideosOneData->array->array);
		for ($i = 0; $i < $videoCount; $i++) 
		{
            $video = $LibraryvideosOneData->array->array[$i];
			
			$title = (string) $video->string[0];
			$url = (string) $video->string[1];
			
			 $videosInfo[] = array('title' => $title, 'url' => $url);
			 
		}

        $LibraryvideosInfoList = array('LibraryvideosInfo' => $videosInfo);
        return $LibraryvideosInfoList;
    }
}
	
	   
	
	
	
	
	
	
	
	